//
//  UICreator.h
//  grammar
//
//  Created by user on 12-6-4.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface UICreator : NSObject

//根据图像名创建UIImageView
+ (UIImageView*)createImageViewFromImagename:(NSString*)imagename;
+ (UIImageView*)createImageViewFromImagename:(NSString*)imagename use2X:(BOOL)use2X;

+ (UILabel*)createLabel:(NSString*) content color:(UIColor*) color font:(UIFont*) font;
+ (UILabel*)createLabel:(NSString*) content frame:(CGRect)frame color:(UIColor*) color font:(UIFont*) font;
+ (UILabel*)createLabel:(NSString*) content fontSize:(int) fontSize;
+ (UILabel*)createLabel:(NSString*) content frame:(CGRect)frame fontSize:(int) fontSize;
+ (UILabel*)createLabel:(NSString*)content constrainedSize:(CGSize)constrainedSize color:(UIColor*)color font:(UIFont*)font;

+ (UITextField*)createTextFieldWithFrame:(CGRect)frame
                                    font:(UIFont*)font
                               textColor:(UIColor*)textColor
                             borderStyle:(UITextBorderStyle)borderStyle
                             placeholder:(NSString*)placeholder
                                delegate:(id<UITextFieldDelegate>)delegate;

+ (UIButton*)createButtonWithTitle:(NSString*)title
                        titleColor:(UIColor*)titleColor 
                             frame:(CGRect)frame 
                            target:(id)target 
                            action  :(SEL)action;

+ (UIButton*)createButtonWithTitle:(NSString*)title
                        titleColor:(UIColor*)titleColor
                              font:(UIFont*)font
                             frame:(CGRect)frame
                        buttonType:(UIButtonType)buttonType
                            target:(id)target
                            action:(SEL)action;

+ (UIButton*)createToggleBtn:(NSString*)imageName1 
                  alterImage:(NSString*)imageName2 
                      target:(id)target 
                      action:(SEL)action;

+ (UIButton*)createButtonWithNormalImage:(NSString*)normalImageName 
                        highlightedImage:(NSString*)highlightedImageName 
                                  target:(id)target
                                  action:(SEL)action
                                   use2X:(BOOL)use2X;

+ (UIButton*)createButtonWithNormalImage:(NSString*)normalImageName 
                        highlightedImage:(NSString*)highlightedImageName 
                                  target:(id)target
                                  action:(SEL)action;

+ (UITableView*)createGroupedTable:(id<UITableViewDelegate, UITableViewDataSource>)delegate 
                             frame:(CGRect)frame 
                            inView:(UIView*)view;

+ (UIImage*)getScaledImage:(UIImage*)originalImage withFixHeight:(float)height;
+ (UIImage*)getScaledImage:(UIImage*)originalImage withFixWidth:(float)width;
+ (UIImage*)getInscribedImage:(UIImage*)srcImage withSize:(CGSize)inscribedSize;
+ (UIImage*)getCircumscribedImage:(UIImage*)srcImage withSize:(CGSize)circumscribedSize;

+ (UIImageView*)createReflectedImageView:(UIImageView *)fromImageView withHeight:(NSUInteger)height;
+ (UIImage*)reflectedImage:(UIImageView *)fromImageView withHeight:(NSUInteger)height;

+ (UIImage*)getEmergedImageFromFirstImage:(UIImage*)firstImage
                                firstSize:(CGSize)firstSize
                              secondImage:(UIImage*)secondImage
                               secondRect:(CGRect)secondRect;

+ (void)makeRoundCorner:(float)value withView:(UIView*)view;

+ (void)makeGameButton:(UIButton*)button;

@end
